<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>传智工作室</title>
</head>

<body>

<div th:replace="header :: nav"></div>

<div class="container">
    <div class="row">
        <div class="col-md-2"></div>
        <div class="col-md-8">
            <div class="list-group" th:each="unit : ${share.content}">
                <a th:href="'/share/'+${unit.id}" class="list-group-item">
                    <div class="panel panel-success">
                        <div class="panel-heading">
                            <label th:text="${unit.title}"></label>
                        </div>
                        <div class="panel-body" th:text="${unit.description}">
                            Panel content
                        </div>
                        <div>
                            <span class="pull-right" th:text="'发表于'+${#temporals.format(unit.publishTime,'yy-MM-dd HH:mm')}"></span>
                            <span class="pull-right" th:text="${unit.staff.realName}"></span>
                        </div>
                    </div>
                </a>
            </div>

            <script th:inline="javascript">
                var pageIndex = [[${page}]]
                console.log(pageIndex)
            </script>
            <div>
                <nav aria-label="...">
                    <ul class="pager">
                        <li class="previous" th:classappend="${page}==0?'disabled'"><a th:href="@{'/index.html?size=5&page='+${page-1}+'&sort=publishTime,desc'}"><span aria-hidden="true">&larr;</span> Before</a></li>
                        <li class="next" th:classappend="not ${share.hasNext()}?'disabled'"><a th:href="@{'/index.html?size=5&page='+${page+1}+'&sort=publishTime,desc'}">Next <span aria-hidden="true">&rarr;</span></a></li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
</div>

</body>

</html>